package com.fjh.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    /**
     * 针对网络请求的配置
     * @param http
     * @throws Exception
     */
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.csrf().disable();
        //给一个登录表单
        http.formLogin();
        //放行健康检查的配置
        http.authorizeRequests()
                .antMatchers("/actuator/**")
                .permitAll();
        super.configure(http);
    }
}
